<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link href="css/index.css" rel="stylesheet">
</head>
<body ng-controller="adminController">
	<div id="content-header">
		<h1>管理员</h1>
	</div>
	<div id="breadcrumb">
		<a href="#!/index" title="返回首页" class="current"><i
			class="icon-home"></i>管理员</a>
	</div>
	<div class="widget-box">
		<div class="clearfix" style="width: 100%">
			<button class="btn btn-info btn" data-toggle="modal"
				data-target="#myModal2" ng-click="addteacher()"
				style="float: left; margin-left: 5px;">新增</button>
		</div>
		<div class="widget-title">
			<h5>管理员信息</h5>
		</div>
		<div class="widget-content nopadding">
			<table class="table table-bordered data-table">
				<thead>
					<tr>
						<th>序号</th>
						<th>管理员账号</th>
						<th>角色</th>
						<th>创建时间</th>
						<th>操作</th>
					</tr>
				</thead>
				<tbody ng-repeat="data in datas">
					<tr class="gradeA">
						<td width="5%"><span ng-bind="$index+1"></span></td>
						<td width="11%"><span ng-bind="data.username"
							ng-hide="data.s"></span><input type="text" style="width: 100px"
							ng-model="data.usernamev" ng-show="data.s"></td>
						<td width="10%"><span ng-bind="data.charatername"
							ng-hide="data.s"></span> <select id="upse" ng-value="data.characterid"
							style="width: 100px" ng-show="data.s">
								<option selected ng-repeat="bdata in bdatas" ng-value="bdata.id"
									ng-bind="bdata.name" />
						</select></td>
						<td width="15%"><span ng-bind="data.createtime"
							ng-hide="data.s"></span></td>

						<td>
							<button class="btn btn-success btn-mini"
								ng-click="toupdate(data)" ng-hide="data.u">修改</button>
							<button class="btn btn-success btn-mini" ng-click="update(data)"
								ng-show="data.u">保存</button>
							<button class="btn btn-info btn-mini" style="margin-left: 20%"
								ng-click="disupdate(data)" ng-show="data.u">取消</button>
							<button ng-hide="data.u" data-toggle="modal"
								data-target="#myModal" ng-click="toUpdate(data)"
								style="margin-left: 20%" class="btn btn-info btn-mini">重置密码</button>
							<button ng-hide="data.u" data-toggle="modal"
								data-target="#myModal1" ng-click="toDeletet(data)"
								style="margin-left: 20%" class="btn btn-danger btn-mini">删除</button>
						</td>
					</tr>
				</tbody>
			</table>
		</div>
	</div>
	<!-- 重置密码 -->
	<div class="modal fade" id="myModal" tabindex="-1" role="dialog"
		aria-labelledby="myModalLabel" aria-hidden="true">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-hidden="true">&times;</button>
					<h4 class="modal-title" id="myModalLabel">修改密码</h4>
				</div>
				<div class="modal-body">
					新密码：<input type="password" ng-model="uPwd" />
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-primary"
						ng-click="updatePwd()" data-dismiss="modal" aria-hidden="true">提交更改</button>
				</div>
			</div>
			<!-- /.modal-content -->
		</div>
		<!-- /.modal -->
	</div>
	<!-- 新增 -->
	<div class="modal fade" id="myModal2" tabindex="-1" role="dialog"
		aria-labelledby="myModalLabel" aria-hidden="true">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-hidden="true">&times;</button>
					<h4 class="modal-title" id="myModalLabel">新增管理员</h4>
				</div>
				<div class="modal-body">
					<div>
						账号：<input type="text" ng-model="newUserName" />
					</div>
					<div>
						密码：<input type="password" ng-model="newPwd" />
					</div>
					<div>
						角色：<select ng-model="newCharacterid">
							<option selected ng-repeat="bdata in bdatas" ng-value="bdata.id"
								ng-bind="bdata.name" />
						</select>
					</div>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-primary" ng-click="add()"
						data-dismiss="modal" aria-hidden="true">确定</button>
				</div>
			</div>
			<!-- /.modal-content -->
		</div>
		<!-- /.modal -->
	</div>
	<!-- 确定操作 -->
	<div class="modal fade" id="myModal1" tabindex="-1" role="dialog"
		aria-labelledby="myModalLabel" aria-hidden="true">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-hidden="true">&times;</button>
					<h4 class="modal-title" id="myModalLabel">确认删除</h4>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
					<button type="button" class="btn btn-primary" ng-click="deletet()"
						data-dismiss="modal" aria-hidden="true">确定</button>
				</div>
			</div>
			<!-- /.modal-content -->
		</div>
		<!-- /.modal -->
	</div>
</body>
</html>